package te;

import cn.kgc.disk.entity.User;
import cn.kgc.disk.service.BeanService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class testUserDao {
    @Test
    public void  test1(){
        ApplicationContext context=new ClassPathXmlApplicationContext("userConfig.xml");
        BeanService beanService=context.getBean(BeanService.class);
        User user=new User();
        user.setUserName("zhangsan");
        user.setAge(23);
        User user1= (User) context.getBean("user");
        beanService.addNewUser(user1);
    }
}
